<?php
/**
 * Created by PhpStorm.
 * User: D
 * Date: 2019/5/11
 * Time: 9:10
 */
header("Access-Control-Allow-Origin:*");
header("Content-Type:application/json;charset=utf-8");
include "dbHelper.php";

if($_SERVER["REQUEST_METHOD"] == "POST"){
    if(isset($_REQUEST["uname"]) && isset($_REQUEST["upwd"])){
        $UAME = $_POST["uname"];
        $UPWD = $_POST["upwd"];
        $sql = "INSERT INTO `useinfo`(`u_name`,`u_pwd`) VALUE ('" . $UAME . "','" . $UPWD . "')";

        //        print_r($sql);
        $relust = dbHelper($sql);
        //        print_r($relust);
        if($relust>=1){
            print_r(json_encode(Array("msg" => "注册成功", "status" => 1)));
        }else{
            print_r(json_encode(Array("msg" => "注册失败", "status" => 0)));
        }

    }


} else {
    print_r(json_encode(Array("msg" => "不支持get请求", "status=>-1")));


}






























